<template>
  <div>
    <h2>登录列表</h2>
    <table border="1">
            <thead>
              <tr>
                <td>用户编号</td>
                <td>用户名</td>
                <td>密码</td>
                <td>状态</td>
              </tr>
            </thead>
            <tbody>
              <tr v-for="em in info" :key="em.did">
                <td>{{ em.did }}</td>
                <td>{{ em.dname }}</td>
                <td>{{(em.dpwd).substring(0,3)+"****"}}</td>
                <td>{{em.state  }}</td>
              </tr>
            </tbody>
          </table>

  </div>
</template>

<script setup lang="ts">
import { ref ,onMounted} from 'vue';
import axios from 'axios';
import { useRouter } from 'vue-router';
const router=useRouter();

const info=ref([{
  did:1,
  dname:"",
  dpwd:'',
  state:"",

}])
//钩子函数
onMounted(()=>{
  xian();
})
//显示
const xian=()=>{
  axios({
    url:"http://localhost:59085/api/CF/dengluInfoxianshi",
    method:"get",
    params:info.value
  }).then((res)=>{

    info.value=res.data;
  }).catch((err)=>{
    console.log(err);
  })
}
</script>

<style scoped>

</style>